function ezbarweb(barvalues, L, U, ColorMat)
% FUNCTION EZBARWEB(BARVALUES, L, U, COLORMAT) plots the bar graph with
% errors. COLORMAT is a matrix of n x 3 which specifies the color of bars,
% where n is the length of BARVALUES.
% written by Taro Kiritani, tarokiritani2008@u.northwestern.edu, 1/14/2011

if isempty(ColorMat)
    ColorMat = repmat([0.5],length(barvalues),3)
end

for k = 1:length(barvalues)
    bar(k, barvalues(k), 'facecolor', ColorMat(k,:))
    hold on;
end
set(gca,'XTick',[1:k])
errorbar([1:k], barvalues, L, U, 'color', 'k','LineStyle','none')
    